<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 数组解构
      function foo() {
        return [1, 2, 3, 4, 5, 6, 7]
      }
      // 对一个数组进行解构
      // 取得的值是对应数组下标(索引)的
      const [arr1, arr2] = foo()
      console.log(arr1) // -> 1
      console.log(arr2) // -> 2
    </script>
  </body>
</html>
